home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Graphics Programming (2nd Edition)
/
Visual Basic Graphics Programming 2nd Edition.iso
/
OldSrc
/
CH1
/
SRC
/
IMAGEPIC.FRM
< prev
next >
Wrap
Text File
|
1995-12-15
|
3KB
|
118 lines
VERSION 4.00
Begin VB.Form ImagePicForm
Caption = "The Image and Picture Properties"
ClientHeight = 3705
ClientLeft = 1605
ClientTop = 1425
ClientWidth = 6150
Height = 4395
Left = 1545
LinkTopic = "Form1"
ScaleHeight = 3705
ScaleWidth = 6150
Top = 795
Width = 6270
Begin VB.CommandButton CmdClear
Caption = "Clear"
Height = 495
Index = 2
Left = 4560
TabIndex = 4
Top = 3120
Width = 855
End
Begin VB.CommandButton CmdClear
Caption = "Clear"
Height = 495
Index = 1
Left = 720
TabIndex = 3
Top = 3120
Width = 855
End
Begin VB.CommandButton CmdCopy
Caption = "Copy"
Height = 495
Left = 2640
TabIndex = 2
Top = 3120
Width = 855
End
Begin VB.PictureBox Pict
Height = 3015
Index = 2
Left = 3120
ScaleHeight = 2955
ScaleWidth = 2955
TabIndex = 1
Top = 0
Width = 3015
End
Begin VB.PictureBox Pict
AutoRedraw = -1 'True
Height = 3015
Index = 1
Left = 0
ScaleHeight = 2955
ScaleWidth = 2955
TabIndex = 0
Top = 0
Width = 3015
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
End
Attribute VB_Name = "ImagePicForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim DrawingIndex As Integer
Dim LastX As Single
Dim LastY As Single
Private Sub CmdClear_Click(Index As Integer)
Pict(Index).Cls
End Sub
Private Sub CmdCopy_Click()
Pict(2).Picture = Pict(1).Image
End Sub
Private Sub mnuFileExit_Click()
Unload Me
End Sub
Private Sub Pict_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
DrawingIndex = Index
Pict(Index).CurrentX = X
Pict(Index).CurrentY = Y
LastX = X
LastY = Y
End Sub
Private Sub Pict_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If DrawingIndex <> Index Then Exit Sub
Pict(Index).Line -(X, Y)
LastX = X
LastY = Y
End Sub
Private Sub Pict_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If DrawingIndex <> Index Then Exit Sub
DrawingIndex = 0
Pict(Index).Line -(X, Y)
End Sub